package fr.upmc.aladyn.methodcallinterception;

import javassist.tools.reflect.Loader;

/**
 * Main method that applies saving and restoration of transactions by 
 * interception of Method calls using Javassist.
 * 
 * @author Thierry Wong
 * @author Seyyid ahmed Ouir 
 */
public class MethodCallInterceptMainTest 
{
	public static void main(String[] args) throws Throwable 
	{
		String myMeta = "fr.upmc.aladyn.methodcallinterception.MyMetaObject";
		String reflectMeta = "javassist.tools.reflect.ClassMetaobject";
		String myApp = "fr.upmc.aladyn.methodcallinterception.Scenario";
		String objetTrans = "fr.upmc.aladyn.shared.ObjetTrans";
		
		Loader cl = null;
		
		try 
		{
			cl = new Loader();
			
			System.out.println("BEGINNING OF APPLICATION.\n");
			cl.makeReflective(objetTrans, myMeta, reflectMeta);
			cl.makeReflective(myApp, myMeta, reflectMeta);			
			System.out.println("ALL CLASSES MADE REFLECTIVE. ");
			
            System.out.println("RUNNING APPLICATION.\n");
			cl.run(myApp, args);
			System.out.println("END OF APPLICATION.\n");	
		}
		catch (Exception e){}
	}
}
